
package com.jiuqi.irs.generator.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for khLedger.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="khLedgerForm"
 */
public class KhLedgerForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _klGuid = null;
   private java.lang.String _proofId = null;
   private java.lang.String _ledgerState = null;
   private java.lang.String _drawYear = null;
   private java.lang.String _drawMonth = null;
   private java.lang.String _drawDay = null;
   private java.lang.String _bankDealTime = null;
   private java.lang.String _ledgerTime = null;
   private java.lang.String _proofCode = null;
   private java.lang.String _orgCode = null;
   private java.lang.String _orgTitle = null;
   private java.math.BigDecimal _money = null;
   private java.lang.String _remark = null;
   private java.lang.String _reserved1 = null;
   private java.lang.String _reserved2 = null;
   private java.lang.String _reserved3 = null;

   /**
    * Standard constructor.
    */
   public KhLedgerForm() {
   }

   /**
    * Returns the klGuid
    *
    * @return the klGuid
    */
   public java.lang.String getKlGuid() {
      return _klGuid;
   }

   /**
    * Sets the klGuid
    *
    * @param klGuid the new klGuid value
    */
   public void setKlGuid(java.lang.String klGuid) {
      _klGuid = klGuid;
   }
   /**
    * Returns the proofId
    *
    * @return the proofId
    */
   public java.lang.String getProofId() {
      return _proofId;
   }

   /**
    * Sets the proofId
    *
    * @param proofId the new proofId value
    */
   public void setProofId(java.lang.String proofId) {
      _proofId = proofId;
   }
   /**
    * Returns the ledgerState
    *
    * @return the ledgerState
    */
   public java.lang.String getLedgerState() {
      return _ledgerState;
   }

   /**
    * Sets the ledgerState
    *
    * @param ledgerState the new ledgerState value
    */
   public void setLedgerState(java.lang.String ledgerState) {
      _ledgerState = ledgerState;
   }
   /**
    * Returns the drawYear
    *
    * @return the drawYear
    */
   public java.lang.String getDrawYear() {
      return _drawYear;
   }

   /**
    * Sets the drawYear
    *
    * @param drawYear the new drawYear value
    */
   public void setDrawYear(java.lang.String drawYear) {
      _drawYear = drawYear;
   }
   /**
    * Returns the drawMonth
    *
    * @return the drawMonth
    */
   public java.lang.String getDrawMonth() {
      return _drawMonth;
   }

   /**
    * Sets the drawMonth
    *
    * @param drawMonth the new drawMonth value
    */
   public void setDrawMonth(java.lang.String drawMonth) {
      _drawMonth = drawMonth;
   }
   /**
    * Returns the drawDay
    *
    * @return the drawDay
    */
   public java.lang.String getDrawDay() {
      return _drawDay;
   }

   /**
    * Sets the drawDay
    *
    * @param drawDay the new drawDay value
    */
   public void setDrawDay(java.lang.String drawDay) {
      _drawDay = drawDay;
   }
   /**
    * Returns the bankDealTime
    *
    * @return the bankDealTime
    */
   public java.lang.String getBankDealTime() {
      return _bankDealTime;
   }

   /**
    * Sets the bankDealTime
    *
    * @param bankDealTime the new bankDealTime value
    */
   public void setBankDealTime(java.lang.String bankDealTime) {
      _bankDealTime = bankDealTime;
   }
   /**
    * Returns the ledgerTime
    *
    * @return the ledgerTime
    */
   public java.lang.String getLedgerTime() {
      return _ledgerTime;
   }

   /**
    * Sets the ledgerTime
    *
    * @param ledgerTime the new ledgerTime value
    */
   public void setLedgerTime(java.lang.String ledgerTime) {
      _ledgerTime = ledgerTime;
   }
   /**
    * Returns the proofCode
    *
    * @return the proofCode
    */
   public java.lang.String getProofCode() {
      return _proofCode;
   }

   /**
    * Sets the proofCode
    *
    * @param proofCode the new proofCode value
    */
   public void setProofCode(java.lang.String proofCode) {
      _proofCode = proofCode;
   }
   /**
    * Returns the orgCode
    *
    * @return the orgCode
    */
   public java.lang.String getOrgCode() {
      return _orgCode;
   }

   /**
    * Sets the orgCode
    *
    * @param orgCode the new orgCode value
    */
   public void setOrgCode(java.lang.String orgCode) {
      _orgCode = orgCode;
   }
   /**
    * Returns the orgTitle
    *
    * @return the orgTitle
    */
   public java.lang.String getOrgTitle() {
      return _orgTitle;
   }

   /**
    * Sets the orgTitle
    *
    * @param orgTitle the new orgTitle value
    */
   public void setOrgTitle(java.lang.String orgTitle) {
      _orgTitle = orgTitle;
   }
   /**
    * Returns the money
    *
    * @return the money
    */
   public java.math.BigDecimal getMoney() {
      return _money;
   }

   /**
    * Sets the money
    *
    * @param money the new money value
    */
   public void setMoney(java.math.BigDecimal money) {
      _money = money;
   }
   /**
    * Returns the remark
    *
    * @return the remark
    */
   public java.lang.String getRemark() {
      return _remark;
   }

   /**
    * Sets the remark
    *
    * @param remark the new remark value
    */
   public void setRemark(java.lang.String remark) {
      _remark = remark;
   }
   /**
    * Returns the reserved1
    *
    * @return the reserved1
    */
   public java.lang.String getReserved1() {
      return _reserved1;
   }

   /**
    * Sets the reserved1
    *
    * @param reserved1 the new reserved1 value
    */
   public void setReserved1(java.lang.String reserved1) {
      _reserved1 = reserved1;
   }
   /**
    * Returns the reserved2
    *
    * @return the reserved2
    */
   public java.lang.String getReserved2() {
      return _reserved2;
   }

   /**
    * Sets the reserved2
    *
    * @param reserved2 the new reserved2 value
    */
   public void setReserved2(java.lang.String reserved2) {
      _reserved2 = reserved2;
   }
   /**
    * Returns the reserved3
    *
    * @return the reserved3
    */
   public java.lang.String getReserved3() {
      return _reserved3;
   }

   /**
    * Sets the reserved3
    *
    * @param reserved3 the new reserved3 value
    */
   public void setReserved3(java.lang.String reserved3) {
      _reserved3 = reserved3;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getKlGuid() == null) {
         errors.add("klGuid", new ActionError("error.klGuid.required"));
      }
      if(getProofId() == null) {
         errors.add("proofId", new ActionError("error.proofId.required"));
      }
      if(getLedgerTime() == null) {
         errors.add("ledgerTime", new ActionError("error.ledgerTime.required"));
      }
      if(getMoney() == null) {
         errors.add("money", new ActionError("error.money.required"));
      }
      // TODO test format/data
      return errors;
   }
}
